package com.wc.AlgoOJ_train.train1.c5.A503;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2024/1/10 20:20
 * @description 夹角有多大II
 * http://43.138.190.70:8888/p/A503
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        double pi = 3.1415926;
        while (n-- > 0) {
            int x1 = sc.nextInt();
            int y1 = sc.nextInt();
            int x2 = sc.nextInt();
            int y2 = sc.nextInt();

            double ans = Math.acos(1.0 * (x1 * x2 + y1 * y2) / (l(x1, y1) * l(x2, y2)));
            System.out.printf("%.2f\n", ans * 180 / pi);
        }
    }

    static double l(double x, double y) {
        return Math.sqrt(x * x + y * y);
    }
}
